<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>佐心，教家长做父母</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" href="assets/css/amazeui.min.css?v=2.9">
    <link rel="stylesheet" href="assets/css/style.css?v=2.3">
    <link rel="stylesheet" href="assets/css/index.css?v=2.3">
    <script>
    	var flag='${param.flag}';
    </script>
    <script>
    	    /** 
     * 返回前一页（或关闭本页面） 
     * <li>如果没有前一页历史，则直接关闭当前页面</li> 
     */  
    function goBack(){  
        if ((navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0)){ // IE  
            if(history.length > 0){  
                window.history.go( -1 );  
            }else{  
                location.href="${ctx}/index.jsp";
            }  
        }else{ //非IE浏览器  
            if (navigator.userAgent.indexOf('Firefox') >= 0 ||  
                navigator.userAgent.indexOf('Opera') >= 0 ||  
                navigator.userAgent.indexOf('Safari') >= 0 ||  
                navigator.userAgent.indexOf('Chrome') >= 0 ||  
                navigator.userAgent.indexOf('WebKit') >= 0){  
      
                if(window.history.length > 1){  
                    window.history.go( -1 );  
                }else{  
                    location.href="${ctx}/index.jsp";
                }  
            }else{ //未知的浏览器  
                window.history.go( -1 );  
            }  
        }  
    }  
    </script><script>
    	    /** 
     * 返回前一页（或关闭本页面） 
     * <li>如果没有前一页历史，则直接关闭当前页面</li> 
     */  
    function goBack(){  
        if ((navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0)){ // IE  
            if(history.length > 0){  
                window.history.go( -1 );  
            }else{  
                location.href="${ctx}/index.jsp";
            }  
        }else{ //非IE浏览器  
            if (navigator.userAgent.indexOf('Firefox') >= 0 ||  
                navigator.userAgent.indexOf('Opera') >= 0 ||  
                navigator.userAgent.indexOf('Safari') >= 0 ||  
                navigator.userAgent.indexOf('Chrome') >= 0 ||  
                navigator.userAgent.indexOf('WebKit') >= 0){  
      
                if(window.history.length > 1){  
                    window.history.go( -1 );  
                }else{  
                    location.href="${ctx}/index.jsp";
                }  
            }else{ //未知的浏览器  
                window.history.go( -1 );  
            }  
        }  
    }  
    </script>
</head>
<body class="">
<header data-am-widget="header" class="am-header am-header-default am-header-fixed">

    <div class="am-header-left am-header-nav">
        <a  onclick="goBack();"  >
            <i class="icon_8"></i>
        </a>
    </div>
    <h1 class="am-header-title" onclick="$('#my-popup').modal('open')">
        <span class="prelative"><span id="span_title">
        <c:if test="${param.flag==1}">
                                                                学业倦怠
                    </c:if>
                    <c:if test="${param.flag==2}">
                                                                亲子关系
                    </c:if>
                    <c:if test="${param.flag==3}">
                                                                教育理念
                    </c:if>
                    <c:if test="${param.flag==4}">
                                                               学习习惯
                    </c:if>
                    <c:if test="${param.flag==5}">
                                                               人际关系
                    </c:if>
                    <c:if test="${param.flag==6}">
                                                              沉迷网络
                    </c:if>
                    <c:if test="${param.flag==7}">
                                                              情绪管理
                    </c:if>
                    <c:if test="${param.flag==8}">
                                                               自控能力
                    </c:if>
        </span><i class="icon_61"></i></span>
    </h1>

    <div class="am-header-right am-header-nav">

    </div>
</header>
<section class="" id="amz-main" data-tag="css-nav">
    <!--banner开始-->
    <div data-am-widget="slider" class="am-slider am-slider-default" data-am-slider='{}'>
        <ul class="am-slides">
            <li onclick="window.location.href='047.html'">
                <a id="srch1" href="javascript:void(0);"><img id="src1" src="assets/images/upload/banner.png"></a>
            </li>
            <li onclick="window.location.href='047.html'">
                <a id="srch2" href="javascript:void(0);"><img id="src2" src="assets/images/upload/banner.png"></a>
            </li>
            <li onclick="window.location.href='047.html'">
                <a id="srch3" href="javascript:void(0);"><img id="src3" src="assets/images/upload/banner.png"></a>
            </li>
        </ul>
    </div>


    <div class="icon_26 am-text-center font-color-12 am-margin-top-sm">
        解决方案
    </div>
    <div class="am-container font-color-15 am-padding-top-xs font-14" id="content">
    </div>

</section>
<!--更新的地方-->
<footer data-am-widget="navbar" class="am-navbar am-cf am-navbar-default bg-white" id="">
    <div class="am-g   am-g-collapse  font-color-11">
        <div class="am-u-sm-4 font-color-1  " id="shouchang">
           <a href="gotoPinggu?flag=${param.flag}"><div class="font-color-15 am-text-center border-right font-14 btn-6" ><span class="prelative"><i class="icon_58"></i>在线评估</span></div></a>
        </div>
        <div class="am-u-sm-4  ">
            <a href="counseKu.jsp"> <div class="font-color-15 am-text-center border-right font-14 btn-6" ><span class="prelative"><i class="icon_59"></i>专家咨询</span></div></a>
        </div>
        <div class="am-u-sm-4 " id="btnmark">
            <a href="jixun.jsp"> <div class="font-color-15 am-text-center border-right font-14 btn-6" ><span class="prelative"><i class="icon_60"></i>集训营</span></div></a>
        </div>
    </div>
</footer>


<!--选择分类-->
<div class="am-popup" id="my-popup">
    <div class="am-popup-inner">

        <header data-am-widget="header" class="am-header am-header-default am-header-fixed ">
            <div class="am-header-left am-header-nav">
                <a class="" data-am-modal-close>
                    <i class="icon_8"></i>
                </a>
            </div>
            <h1 class="am-header-title">
                选择问题分类
            </h1>

        </header>

        <section class="" data-tag="css-nav">
            <div class="filter-container">
                <ul class="list-group" >
                    <li class="fis-filter-item letter"><a>当前问题分类</a></li>
                    <li class="fis-filter-item " >
                    <a>
                    <c:if test="${param.flag==1}">
                                                                学业倦怠
                    </c:if>
                    <c:if test="${param.flag==2}">
                                                                亲子关系
                    </c:if>
                    <c:if test="${param.flag==3}">
                                                                教育理念
                    </c:if>
                    <c:if test="${param.flag==4}">
                                                               学习习惯
                    </c:if>
                    <c:if test="${param.flag==5}">
                                                               人际关系
                    </c:if>
                    <c:if test="${param.flag==6}">
                                                              沉迷网络
                    </c:if>
                    <c:if test="${param.flag==7}">
                                                              情绪管理
                    </c:if>
                    <c:if test="${param.flag==8}">
                                                               自控能力
                    </c:if>
                    </a></li>
                    <li class="fis-filter-item letter"><a>选择其他问题分类</a> </li>
                </ul>
                <ul class="list-group" data-node="question-type">
                    <c:if test="${param.flag!=1}"><li class="fis-filter-item <c:if test="${param.flag==1}">selected</c:if>" data-am-modal-close><a>学业倦怠</a><i></i></li></c:if> 
                    <c:if test="${param.flag!=2}"><li class="fis-filter-item <c:if test="${param.flag==2}">selected</c:if>" data-am-modal-close><a>亲子关系</a><i></i></li></c:if> 
                    <c:if test="${param.flag!=3}"><li class="fis-filter-item <c:if test="${param.flag==3}">selected</c:if>" data-am-modal-close><a>教育理念</a><i></i></li></c:if> 
                    <c:if test="${param.flag!=4}"><li class="fis-filter-item <c:if test="${param.flag==4}">selected</c:if>" data-am-modal-close><a>学习习惯</a><i></i></li></c:if> 
                    <c:if test="${param.flag!=5}"><li class="fis-filter-item <c:if test="${param.flag==5}">selected</c:if>" data-am-modal-close><a>人际关系</a><i></i></li></c:if> 
                    <c:if test="${param.flag!=6}"><li class="fis-filter-item <c:if test="${param.flag==6}">selected</c:if>" data-am-modal-close><a>沉迷网络</a><i></i></li></c:if> 
                    <c:if test="${param.flag!=7}"><li class="fis-filter-item <c:if test="${param.flag==7}">selected</c:if>" data-am-modal-close><a>情绪管理</a><i></i></li></c:if> 
                    <c:if test="${param.flag!=8}"><li class="fis-filter-item <c:if test="${param.flag==8}">selected</c:if>" data-am-modal-close><a>自控能力</a><i></i></li></c:if> 
                </ul>
            </div>
        </section>
    </div>
</div>

<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/amazeui.min.js"></script>
<script>
    $(function () {
    	var jsonAdvert=$.ajax({url:"getQuestionType?type="+flag,async:false});
        var advert=JSON.parse(jsonAdvert.responseText);
        if(advert.resultCode=="0"){
        	$("#content").html(advert.questionTypeList[0].content);
        }
        
    	var jsonAdvert2=$.ajax({url:"getAdvertPic2?advertType="+flag,async:false});
        var advert2=JSON.parse(jsonAdvert2.responseText);
        if(advert2.resultCode=="0"){
        	var leng=advert2.advertPicList.length;
        	if(leng>3){
        		leng=3;
        	}
        	for(var i=0;i<leng;i++){
        	   $("#src"+(i+1)).attr("src",advert2.advertPicList[i].url);
        	   $("#srch"+(i+1)).attr("href","gotoPicNews?advertId="+advert2.advertPicList[i].id);
        	}
        }
    
        // 选择分类
        $("[data-node='question-type']").find(" li").click(function () {
            $("[data-node='question-type']").find(" li").removeClass("selected");
            $(this).addClass("selected");
            var cnt=$(this).text();
            
            if(cnt=="学业倦怠"){
            	location.href="quesfenlei.jsp?flag=1";
            }
            if(cnt=="亲子关系"){
            	location.href="quesfenlei.jsp?flag=2";
            }
            if(cnt=="教育理念"){
            	location.href="quesfenlei.jsp?flag=3";
            }
            if(cnt=="学习习惯"){
            	location.href="quesfenlei.jsp?flag=4";
            }
            if(cnt=="人际关系"){
            	location.href="quesfenlei.jsp?flag=5";
            }
            if(cnt=="沉迷网络"){
            	location.href="quesfenlei.jsp?flag=6";
            }
            if(cnt=="情绪管理"){
            	location.href="quesfenlei.jsp?flag=7";
            }
            if(cnt=="自控能力"){
            	location.href="quesfenlei.jsp?flag=8";
            }
        });
    });
</script>
</body>
</html>